\documentclass{standalone}
\usepackage{tikz}
\usepackage{ctex,siunitx}
\usepackage{tkz-euclide}
\usepackage{amsmath}
\usetikzlibrary{patterns, calc}
\usetikzlibrary {decorations.pathmorphing, decorations.pathreplacing, decorations.shapes,}
\begin{document}
\small
\begin{tikzpicture}[>=stealth, scale=0.8, domain=0:3.5*pi, samples=200]
  \draw [->](0,0)node [left]{$O$}--(12.5,0) node [below]{$x$};
  \draw [->](0,-1.2)--(0,1.5) node [right]{$y$};
  \draw [very thick, domain=0:3.5*pi]  plot (\x,{cos(\x r)});
  \draw [very thick, domain=3.5*pi:12]  plot (\x,0);
  \draw [dashed](.5*pi, 0) -- (.5*pi, 1.5);  
  \draw [dashed](pi,-1) -- (pi, 1.5);  
  \draw [dashed](1.5*pi, 0) -- (1.5*pi,1.5);     
\end{tikzpicture}
\end{document}